﻿@inherits BaseComponent

@if (Model.HasItem)
{
    <div class="ant-toolbar">
        @foreach (var item in Model.Items)
        {
            var itemName = Language.GetString(item);
            <Button Danger="@(item.Style=="danger")" Type="@ButtonType.Primary" Icon="@item.Icon" OnClick="e=>Model.OnItemClick?.Invoke(item)">@itemName</Button>
            @if (item.Children != null && item.Children.Count > 0)
            {
                <AntDropdown Context="Context" Text="@itemName" Items="item.Children" OnItemClick="Model.OnItemClick" />
            }
        }
    </div>
}

@code {
    [Parameter] public ToolbarModel Model { get; set; }
}